package net.huashitong.ssydt.provider.exam.service;


import net.huashitong.ssydt.exam.entity.SsExamArticleRecord;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.10.30
 */
public interface SsExamArticleRecordService {

    int deleteByPrimaryKey(Long id);

    int insert(SsExamArticleRecord record);

    int insertSelective(SsExamArticleRecord record);

    SsExamArticleRecord selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SsExamArticleRecord record);

    int updateByPrimaryKey(SsExamArticleRecord record);

    SsExamArticleRecord getNotHistoryByUserIdAndArticleId(String userId, Long articleId);

    /**
     * 统计该文章测评已交卷数
     *
     * @param articleId
     * @return
     */
    int countSubmittedByArticleId(Long articleId);

    /**
     * 统计该文章测评小于等于correctNumber的已交卷数
     *
     * @param articleId
     * @param correctNumber
     * @return
     */
    int countSubmittedByArticleIdWithLessOrEqualsCorrectNumber(Long articleId, Integer correctNumber);
}
